package com.sam.security.dao;

import java.util.List;
import java.util.Map;

import com.sam.core.domain.Page;
import com.sam.security.domain.AsyncTreeNode;
import com.sam.security.domain.Authority;
import com.sam.security.domain.Menu;
import com.sam.security.domain.Permission;
import com.sam.security.domain.Resource;
import com.sam.security.domain.Role;
import com.sam.security.domain.User;

/**
 * 权限管理模块dao接口
 * @project EMan
 * @author Sam
 * @version
 * @date Feb 10, 2009 5:35:59 PM
 */
public interface SecurityDao {
	public void filterResource(Resource resource, Page<Resource> page);

	public void searchResource(String query, Page<Resource> page);

	public void loadResource(Resource resource, Page<Resource> page);

	public void loadResource(Page<Resource> page);

	public void addMenu(Menu menu);

	public void addPermission(Permission permission);

	public void addPermissionResource(String permissionId, String resourceId);

	public void addResource(Resource resource);

	public void addRole(Role role);

	public void addRolePermission(String roleId, String userFunctionName);

	public void addRolePermissionAll(String roleId, String menuId);

	public void deletePermissionResource(String permissionId);

	public void deleteReource(String resourceId);

	public void deleteRole(String roleId);

	public void deleteRolePermission(String roleId, String menuId);

	public void deleteMenu(String menuId);

	public void deletePermission(String permissionId);

	public void updatePerson(String[] ids);

	public List<Resource> loadResource();

	public List<Resource> loadResourceById(int resourceId);

	public List<Role> loadRole(Page<Role> page);

	public List<Role> loadRole(String roleId);

	public List<Menu> queryAllMenu();

	public List<Authority> queryAuthsByUsername(String username);

	public List<Permission> queryCheckedPermission(String roleId, String menuId);

	public String queryLastSubMenuId(String parentId);

	public Menu queryMenuInfo(String id);

	public Permission queryPermissionInfo(String id);

	public List<Resource> queryPermissionResource(String permissionId);

	public List<Map<String, Object>> queryRequestMap();

	public List<AsyncTreeNode> querySubMenus(String id);

	public List<AsyncTreeNode> querySubMenusForPermission(String id);

	public List<Permission> queryUncheckedPermission(String roleId, String menuId);

	public User queryUserByUsername(String username);

	public List<AsyncTreeNode> queryUserFunctions(String id);

	public List<Resource> searchResource(String search);

	public List<Role> searchRole(String query, Page<Role> page);

	public void updateMenu(Menu menu);

	public void updatePermission(Permission permission);

	public void updateReource(Resource resource);

	public void updateRole(Role role);
}
